//
//  ViewController+ClassProperties.m
//  ClassProperties
//
//  Created by 张亮亮 on 2018/4/2.
//  Copyright © 2018年 张亮亮. All rights reserved.
//

#import "ViewController+ClassProperties.h"
#import <objc/runtime.h>
static const char kSomeHeightKey = '\0';
@implementation ViewController (ClassProperties)
#pragma mark - runtime的关联方式
+ (NSString *)cateString {
    return objc_getAssociatedObject(self, &kSomeHeightKey);
}
+ (void)setCateString:(NSString *)cateString {
    objc_setAssociatedObject(self, &kSomeHeightKey, cateString, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
#pragma mark - 模仿主类中的方式
//static NSString *_cateString = nil;
//+ (NSString *)cateString {
//    return _cateString;
//}
//+ (void)setCateString:(NSString *)cateString {
//    _cateString = cateString;
//}

@end
